<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>v-for</title>
  <script src="/vue.js"></script>
</head>
<body>
  <div id="root">
    <!-- <ul>
      <li v-for="value,key,index in items">
        {{key}} {{index}}
        <span v-for="item in value">
          {{item}}
        </span>
      </li>
      <li v-for="value,key in items.item3">
        {{value}}
      </li>
    </ul> -->
    <!-- <template v-for="li in list">
      <div>0</div>
      <div>1</div>
      <div>2</div>
    </template> -->

    <!-- <ul>
      <li v-for="li in list2">
        {{li}}
      </li>
    </ul>

    <ul>
      <li v-for="value,key in obj">
        {{key}} - {{value}}
      </li>
    </ul>

    <ul>
      <li v-for="value in 'hello'">
        {{value}}
      </li>
    </ul>

    <ul>
      <li v-for="value in x">
        {{value}}
      </li>
    </ul> -->

    <my-comp :num="v" v-for="v in 10"></my-comp>
  </div>
  <script>
    Vue.component('my-comp', {
      props: ['num'], // properties attributes
      template: `
        <div>hello {{this.num}}</div>
      `
    })

    var vm = new Vue({
      el: '#root',
      data: {
        list: [
          'a', 'b', 'c'
        ],
        x: 10,
        obj: {
          x: 0,
          y: 1,
          z: 2
        },
        items: {
          item1: ['x', 'y', 'z'],
          item2: ['x', 'y', 'z'],
          item3: ['x', 'y', 'z']
        }
      },
      computed: {
        list2() {
          return this.list.map((value) => {
            return value + value
          })
        }
      },
    })
  </script>
</body>
</html>